package com.huqu.daoimpl;

import java.sql.Types;
import java.util.ArrayList;
import java.util.List;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Repository;

import com.huqu.basedao.QbDaoSupport;
import com.huqu.basedao.QbEntityMapper;
import com.huqu.basedao.QbSqlParam;
import com.huqu.dao.N400Dao;
import com.huqu.entities.N300;
import com.huqu.entities.N400;
import com.huqu.utils.ApplicationConstant;
import com.huqu.utils.SqlNames;

@Repository(value = ApplicationConstant.REPOSITORY_NAME_N400)
@Scope("prototype")
public class N400DaoImpl extends QbDaoSupport implements N400Dao {

	@Override
	public List<N400> ListOfTabN400(int nIDTHELOAI, int nNUMBER) {
		List<QbSqlParam> listParams = new ArrayList<QbSqlParam>();
		listParams.add(new QbSqlParam(Types.INTEGER, nIDTHELOAI));
		listParams.add(new QbSqlParam(Types.INTEGER, nNUMBER));
		setQueenBListSqlParams(listParams);
		// set sql name
		setQueenBSqlName(SqlNames.LISTOFTABN400);
		// set row mapper
		setQueenBEntityMapper(new QbEntityMapper(N400.class));
		executeQueenBQuery();
		List<N400> listN400 = (List<N400>) getListReturn();
		return listN400;
	}

	@Override
	public List<N400> ListOfTabN400INFO(String vMD5VIDEO) {
		List<QbSqlParam> listParams = new ArrayList<QbSqlParam>();
		listParams.add(new QbSqlParam(Types.CHAR, vMD5VIDEO));
		setQueenBListSqlParams(listParams);
		// set sql name
		setQueenBSqlName(SqlNames.LISTOFTABN400INFO);
		// set row mapper
		setQueenBEntityMapper(new QbEntityMapper(N400.class));
		executeQueenBQuery();
		List<N400> listN400 = (List<N400>) getListReturn();
		return listN400;
	}

}
